package com.jy.rhin.infra.repo.notfication.message;

import com.jy.framework.base.exception.BaseException;
import com.jy.framework.base.exception.ErrorType;

/**
 *  @author: yaojun
 *  @Date: 2022/9/20 16:07
 *  @Description: 事务消息异常
 */
public class TranscationMessageException extends BaseException {

    public TranscationMessageException(Error error, Throwable t) {
        super(error, t);
    }

    public enum Error implements ErrorType {
        ERROR_GET_ARGS("ERROR_GET_ARGS", "获取参数错误，监听方法参数顺序:Message, Channel")
        ,ERROR_ACK("ERROR_ACK", "ACK失败")
        ,ERROR_GET_MD5("ERROR_GET_MD5", "获取MD5算法错误")
        ;

        String code;
        String msg;

        Error(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }
    }
}
